<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ taglib uri="/WEB-INF/tlds/att.tld" prefix="att"%>
<html>

<head> 
<meta name="decorator" content="moduleView"/> 
<script type="text/javascript" src="${staticPath}/js/decimalinput.js"></script>
<script type="text/javascript">

function closeContract(){
	top.$.jBox.confirm('确认要终止合同吗？','系统提示',function(v,h,f){
		if(v=='ok'){
			$("#terminateDateModal").load('${contextPath}/biz/contract/commonContract/${id}/updateTerminateDate?navId=${navId}',function(){
				$("#terminateDateModal").modal("show");
			});
		}
	},{buttonsFocus:1});
	
}

	function getUrl(tag,url){ 
		  $('#contractBrand').attr("src",url);
	}
	function btn_postpone_onClick(){
		$("#myModal").load('${contextPath}/${associated.versionUrl}${associated.mainId}/${associated.versionId}/${associated.assistId}/getMainVersion?contractAttribute=40&navId=${navId}',function(){  
		    $("#myModal").modal("show");  
		}); 
	}
	function btn_onClick(){
		$("#myModal").load('${contextPath}/${associated.versionUrl}${associated.mainId}/${associated.versionId}/${associated.assistId}/getMainVersion?contractAttribute=70&navId=${navId}',function(){  
		    $("#myModal").modal("show");  
		}); 
	}
	function getUrlVersionFrame(url){ 
		  $("#versionFrame").attr("src",url);
	}
</script>
<script type="text/javascript">
var num = '${fn:length(assbrand)}';
var num_items='${fn:length(assitems)}';
var num_base='${fn:length(assbaseitems)}';
var storeId1 ='${associatedContract.storeId}'
var floorId1 ='${associatedContract.floorId}'
var  formart ="${associatedContract.formatId}"
var taxTypeCode ="${associatedContract.taxTypeCode}"
var taxRateCode ='${associatedContract.taxRateCode}'
function sendSap(){
	$.getJSON(Com_Parameter.ContextPath + "/biz/contract/commonContract/${id}/sendToSap?s_bean=commonZYSendSapService", function(data) {
		top.$.jBox.tip(data,'warning');
	});
}
</script>
<script type="text/javascript" src="${staticPath}/js/contract.js"></script>
<script src="${staticPath}/js/jQuery.FillOptions.js"></script>
<link rel="stylesheet" href="${staticPath}/lib/ztree/3.5/css/zTreeStyle/zTreeStyle.css" type="text/css">
<script src="${staticPath}/js/jquery-dialog.js" type="text/javascript"></script>
<script src="${staticPath}/lib/ztree/3.5/js/jquery.ztree.all-3.5.js" type="text/javascript"></script>
<link href="${staticPath}/lib/chosen/1.1.0/chosen.min.css" rel="stylesheet" type="text/css">
<script src="${staticPath}/lib/chosen/1.1.0/chosen.jquery.js" type="text/javascript"></script>
<script src="${staticPath}/js/ossp-jquery-chosen.js" type="text/javascript"></script>
<style type="text/css">
#barndModal .modal-dialog  {width:60%;}
#assitems .modal-dialog  {width:60%;}
#assbasemodal .modal-dialog  {width:60%;}
#terminateDateModal .modal-dialog  {width:30%;}
.texthidden{ width:190px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
</style>
</head>
<body>
	<div class="Report_f">
		<div class="Report_f_1">
		<div >
				  <div class="Report_f_title_1">
				    		自营<c:if test="${associated.isModifyContract =='1'}">变更</c:if>
						<c:if test="${associated.isModifyContract !='1'}">
						<ossp:value dictType="CONTRATC_ATTRIBUTE" key="${associated.contractAttribute}"></ossp:value>
						</c:if>合同
				  </div>
			<input type="hidden" id='contract_type' value="selfassociated">
		   <ul class="nav nav-tabs Report_f_title_2" id="myTab">
			  <li class="active"><a href="#home" data-toggle="tab">合同基本信息</a></li>
			  <li><a href="#shop_tab"  data-toggle="tab" onclick=""  >商铺信息</a></li> 
			  <li><a href="#contractSupplier_tab"  data-toggle="tab" onclick=""  >供应商基本信息</a></li> 
			  <li><a href="#contractBrand_tab"  data-toggle="tab" >合同品牌信息</a></li> 
			  <li><a href="#contractCommnWhere_tab"  data-toggle="tab"  >合同条款</a></li>
			   <li><a href="#workflow" data-toggle="tab">流程审批</a></li> 
			   <li><a href="#diagram" data-toggle="tab">流程图</a></li> 
			   <li><a href="#contract_hist"  data-toggle="tab" onclick="getUrlVersionFrame('${contextPath}/${associated.versionUrl}/${associated.mainId}/${associated.versionId}/${associated.assistId}/getHistoryVersion?navId=${navId}')" >历史版本</a></li> 
			 </ul> 
			<div class="tab-content Report_f_title_3">
			  <div class="tab-pane active" id="home">
				  	  <div class="Report_f_title_4">
				
										<input id="contractArea" type="hidden"/> 
									<input id="salesVolume" type="hidden"/> 
									<input id="benefit" type="hidden"/> 
									<input id="areaCoefficient" type="hidden"/> 
									<input type="hidden" id="suppierOperation"  value="${associated.suppierOperation}"/>
									<input id="storeId" value="${associated.storeId}" type="hidden"/> 
									<input type="hidden" id="supplierNo" value="${associated.supplierNo}"/>
					   	<div class="f_2">
										<div class="form-group col-sm-5">
											<label for="inputtext3" class="col-sm-5	 f_4">合同编号:</label>
											<div class="col-sm-5 f_6">
												${associated.contractNo}
											</div>
										</div>
					
									
										<div class="form-group col-sm-7">
											<label for="inputtext3" class="col-sm-5 f_4">合同名称:</label>
											<div class="col-sm-7">
												${associated.subject}
											</div>
										</div>
									</div>
		
								<div class="f_3">
									<div class="form-group col-sm-5">
										<label for="inputtext3" class="col-sm-5 f_4">管理区域:</label>
										<div class="col-sm-5">
											${associated.area}
										</div>
										
									</div>
							
					
									<div class="form-group col-sm-7">
										<label for="inputtext3" class="col-sm-5 f_4">签约门店:</label>
										<div class="col-sm-7">
											${associated.store}
										</div>
										
									</div>
								</div>
							
								<div class="f_2">
									<div class="form-group col-sm-5">
										<label for="inputtext3" class="col-sm-5 f_4">经营楼层:</label>
										<div class="col-sm-6">
											${associated.floor}
											
											<input type="hidden" id="floorId"   value="${associated.floorId}" />
										</div>
										
									</div>
								
					
									<div class="form-group col-sm-7">
										<input type="hidden" id="shopIds" name="assshopsList[0].shopIds" value="${shopId}" />
										<label for="shop_lab" class="col-sm-5 f_4">签约商铺:</label>
										<div class="col-sm-7">
											${shopName}
											
										</div>
									</div>
							  </div>
					
							<div class="f_3">
									<div class="form-group col-sm-5">
										<label for="contractArea" class="col-sm-5 f_4">合同签订面积:</label>
										<div class="col-sm-6">
										 ${associated.contractArea}
										</div>
									</div>
								
									<div class="form-group col-sm-7">
										<label for="areaCoefficient_lab" class="col-sm-5 f_4">商铺面积分摊系数:</label>
										<div class="col-sm-7">
										    ${associated.areaCoefficient}
										</div>
									</div>
							</div>
							<div class="f_2">
									<div class="form-group col-sm-5">
										<label for="signBy_lab" class="col-sm-5 f_4">合同签订人:</label>
										<div class="col-sm-6">
											${associated.signBy}
										</div>
									</div>
									<div class="form-group col-sm-7">
										<label for="signBody_lab" class="col-sm-5 f_4">签约主体:</label>
										<div class="col-sm-7">
										   ${associated.baseShop.companyName}
										</div>
									</div>
							</div>
							<div class="f_3">
								<div class="form-group col-sm-5">
										<label for="inputtext3" class="col-sm-5	 f_4">是否变更合同:</label>
									<div class="col-sm-6 ">
										<input type="hidden" id="isModifyContract" value="${associated.isModifyContract}">
										<ossp:value dictType="YESORNO" key="${associated.isModifyContract}"></ossp:value>
									</div>
								</div>
								<c:if test="${associated.isModifyContract == '1' }">
											<div class="form-group col-sm-7">
												<label for="signBody_lab" class="col-sm-5 f_4">合同生效日期:</label>
												<div class="col-sm-7">
												   <fmt:formatDate value="${associated.effectDate}" type="both" pattern="yyyy-MM-dd"/>
												</div>
											</div>
								</c:if>
							</div>
							<div class="f_2">
									<div class="form-group col-sm-5">
										<label for="purOrg_lab" class="col-sm-5 f_4">采购组织:</label>
										<div class="col-sm-6">
										
											<ossp:value dictType="PGROUP" key="${associated.purOrg}"></ossp:value>	
										</div>
										
									</div>
									<div class="form-group col-sm-7">
										<label for="inputtext3" class="col-sm-5	 f_4">目标销售额:</label>
											<div class="col-sm-6"> 
												<fmt:formatNumber value="${associated.salesVolume}" pattern="#,#0.00#"/>
											</div>
									</div>
							</div>
							<div class="f_3">
									<div class="form-group col-sm-5">
										<label for="startDate_lab" class="col-sm-5 f_4">合同起始日期:</label>
										<div class="col-sm-6">
										   <fmt:formatDate value="${associated.startDate}" type="both" pattern="yyyy-MM-dd"/>
	                					</div>
									</div>
							
									<div class="form-group col-sm-7">
										<label for="endDate_lab" class="col-sm-5 f_4">合同终止日期:</label>
										<div class="col-sm-7">
										<fmt:formatDate value="${associated.endDate}" type="both" pattern="yyyy-MM-dd"/>
										  
	                				</div>
								</div>
							</div>
							
							<div class="f_2">
									<div class="form-group col-sm-5">
										<label for="recieveStatus_lab" class="col-sm-5 f_4">文档领取:</label>
										<div class="col-sm-6">
												 <ossp:value   dictType="CONTRACT_TEXT_STATE" key="${associated.recieveStatus}"></ossp:value>
											
										</div>
									</div>
					
						    
									<div class="form-group col-sm-7">
										<label for="inputtext3" class="col-sm-5 f_4">撤柜日期:</label>
										<div class="col-sm-7">
											<fmt:formatDate value="${associated.terminateDate}" type="both" pattern="yyyy-MM-dd"/>
										</div>
									</div>
							</div>
							
						<div class="f_3">
							<div class="form-group col-sm-5">
										<label for="recieveStatus_lab" class="col-sm-5 f_4">业态:</label>
										<div class="col-sm-6">
												 ${associated.format.name}
										</div>
							</div>
								<div class="form-group col-sm-7">
										<label for="recieveStatus_lab" class="col-sm-5 f_4">经营门店:</label>
										<div class="col-sm-7">
												<c:forEach items="${associated.storeList}" var="storeEntry" varStatus="i">${storeEntry.store},</c:forEach>
										</div>
							</div>
						</div>
						
						<div class="f_2">
							<div class="form-group col-sm-5">
										<label for="inputtext3" class="col-sm-5	 control-label f_4">合同状态:</label>
										<div class="col-sm-6 f_6">
											 <ossp:value dictType="CONTRACT_STATE" key="${associated.contractStatus}"></ossp:value>
										</div>
							</div>
							<div class="form-group col-sm-7">
										<label for="recieveStatus_lab" class="col-sm-5 f_4">合同属性:</label>
										<div class="col-sm-7">
												<ossp:value dictType="CONTRATC_ATTRIBUTE" key="${associated.contractAttribute}"></ossp:value>
										</div>
							</div>
						</div>
						
						<div class="f_3">
							<div class="form-group col-sm-5">
										<label for="inputtext3" class="col-sm-5	 control-label f_4">历史合同号:</label>
										<div class="col-sm-6 f_6">
											 ${associated.historyContractNo}
										</div>
							</div>
							<div class="form-group col-sm-7">
										<label for="recieveStatus_lab" class="col-sm-5 f_4">是否发起意向:</label>
										<div class="col-sm-6">
													<ossp:value dictType="YESORNO" key="${associated.isApprove}"></ossp:value>
										</div>
							</div>
						</div>
						
						<div class="f_2">
							<div class="form-group col-sm-5">
								<label for="recieveStatus_lab" class="col-sm-5 f_4">合同文本开始日期:</label>
								<div class="col-sm-6">
										<fmt:formatDate value="${associated.textStartDate}" pattern="yyyy-MM-dd"/> 
								</div>
							</div>
							<div class="form-group col-sm-7">
								<label for="inputtext3" class="col-sm-5	 control-label f_4">合同文本结束日期:</label>
								<div class="col-sm-7 f_6">
									<fmt:formatDate value="${associated.textEndDate}" pattern="yyyy-MM-dd"/> 
								</div>
							</div>
						</div>
							<!-- *************************************************** -->	
							<div class="f_3">
									<table class="table " id="table1">
										<thead>
											<tr>
													<th>费用项目</th>
													<th>费用内容</th>
											</tr>
										</thead>
										<tbody>
											<tr>
												<td>供应商用电</td>
												<td><ossp:radio disabled="disabled" defaultChecked="${associated.isUndertakeElec}" name="isUndertakeElec" dictType="SUPPLIER_POWER"></ossp:radio></td>
											</tr>
									<%-- 		<tr>
												<td>自派导购</td>
											
												<td>
												<div class="form-group">
												<div class="col-sm-4"> 
												<ossp:radio  disabled="disabled" defaultChecked="${associated.guideType}" dictType="GUIDE_TYPE" onchange="changeSelect('#guideType',this.value)">
													
												</ossp:radio>
												
												</div>
												<div class="col-sm-5">
												<input class="form-control" readonly="readonly" value="${associated.guideAmount}">
												</div>
												</div>
												</td>
											</tr> --%>
										
											<tr>
												<td>员工制服</td>
												<td><ossp:radio disabled="disabled"  dictType="WORK_CLOTHES" defaultChecked="${associated.workClothes}" onchange="changeSelect('#workClothes',this.value)" name="workClothes_radio" ></ossp:radio></td>
											</tr>
											<tr>
												<td>培训费</td>
												<td><ossp:radio disabled="disabled"  dictType="COMMN_DICT" defaultChecked="${associated.isTraining}" onchange="changeSelect('#workClothes',this.value)" name="isTraining" ></ossp:radio></td>
											</tr>
											<tr>
												<td>工卡费</td>
												<td><ossp:radio disabled="disabled"  dictType="COMMN_DICT" defaultChecked="${associated.isJobCard}" onchange="changeSelect('#workClothes',this.value)" name="isJobCard" ></ossp:radio></td>
											</tr>
											<tr>
												<td>品牌形象维护费</td>
												<td><ossp:radio disabled="disabled"  dictType="COMMN_DICT" defaultChecked="${associated.isBrandImage}" onchange="changeSelect('#workClothes',this.value)" name="isBrandImage" ></ossp:radio></td>
											</tr>
										</tbody>
									</table>
								
							</div>
							<div class="f_2">
									<h4>
										合同条件--特殊条款信息
									</h4>
									<table class="table table-striped " id="table1">
										<thead>
											<tr>
												<th>扣款项编码<span style="color: red;">*</span></th>
												<th>条件</th>
												<th>金额</th>
												<th>描述</th>
											</tr>
										</thead>
										<tbody>
											<c:forEach items="${itemCodeList}" var="items" varStatus="var">
												<tr>
													
													<td class="o-l-tab-ckb">${items.items.itemName}</td>
													<td class="o-l-tab-ckb">
													<ossp:value dictType="${items.items.dicType}" key="${items.conditions}"></ossp:value></td>
													<td class="o-l-tab-ckb">${items.amount}</td>
													<td class="o-l-tab-ckb">${items.remark}</td>
												</tr>
											</c:forEach>
											
											<!-- 隐藏行，用于新增明细end -->
										</tbody>
									</table>
									<input type="hidden" name="delContactId" id="delContactId">
							</div>
								<!-- *************************************************** -->	
						<div class="f_2">
									<div class="form-group">
										<label for="inputtext3" class="col-sm-2 f_4">附件列表:</label>
										<div class="col-sm-9">
											<textarea rows="5" cols="120" class="form" readonly="readonly">${associated.contractAttachment}</textarea>
											
										</div>
										
									</div>
						</div>
								<!-- *************************************************** -->	
							<div class="f_2">
									<div class="form-group">
										<label for="remarks" class="col-sm-2 f_4">备注:</label>
										<div class="col-sm-9">
											<textarea rows="5" cols="120" class="form" readonly="readonly">${associated.remarks}</textarea>
											
										</div>
									
									</div>
							</div>
							<div class="f_2">
									<div class="form-group col-sm-5">
										<label for="createTime_lab" class="col-sm-5 f_4">创建人:</label>
										<div class="col-sm-7">
											${createBy}
	                					</div>
									</div>
							
									<div class="form-group col-sm-7">
										<label for="createTime_lab" class="col-sm-5 f_4">创建时间:</label>
										<div class="col-sm-7">
											<fmt:formatDate value="${associated.createTime}" type="both" pattern="yyyy-MM-dd HH:mm:ss"/>
	                					</div>
									</div>
							</div>
					
				  </div>
				 </div>
				   <div class="tab-pane" id="shop_tab">
					  <div>
					  		<table class="table table-striped table-hover o-l-table" id="table1">
									<thead>
											<tr>
												<th>铺位号</th> 
												<th>招商编号</th> 
												<th>面积</th> 
											</tr>
									</thead>
									<tbody id="shopInfo">
									<c:forEach items="${associated.assshopsList}" var="shops" varStatus="i">
									<tr  data-herf="" data-target="_self">
											<td >${shops.shopInfo.berthId}</td>
											<td >${shops.shopId}</td>
											<td >${shops.shopInfo.area}</td>
									</tr>
									</c:forEach>
									
					  				</tbody>
					  	</table>
					  </div>
				  </div>
				 <div class="tab-pane" id="contractSupplier_tab">
				
						<div class="f_2">
								<div class="form-group col-sm-6 ">
									<label for="inputtext3" class="col-sm-4	 f_4">合同供应商:</label>
									<div class="col-sm-6">
									<input type="hidden" id="supplierNo" value="${associated.supplierNo}"/>
									${associated.supplierName}
									</div>
								</div>
								<div class="form-group col-sm-6">
									<label for="inputtext3" class="col-sm-4 f_4">税票类型:</label>
									<div class="col-sm-6" id="taxTypeDiv">
								
										<ossp:value dictType="INVOICE_TYPE" key="${associated.taxTypeCode}"></ossp:value>
									</div>
								</div>
						</div>
								
						<div class="f_2">			
							<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-4 f_4">税率:</label>
										<div class="col-sm-6">
											${associated.taxRate}
											
										</div>
									</div>
							<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-4	 f_4">结算周期:</label>
											<div class="col-sm-6"> 
											<ossp:value dictType="BALANCE_CYCLE" key="${associated.settlementCycle}"></ossp:value>
											</div>
							</div>
						</div>
						<div class="f_2">			
								<div class="form-group col-sm-6">
											<label for="inputtext3" class="col-sm-4 f_4">收银方式:</label>
											<div class="col-sm-6">
											<ossp:value dictType="CONTRACT_CHCKOUTYPE" key="${associated.checkoutType}"></ossp:value>
										
											  
											</div>
								</div>
						
									<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-4	 f_4">付款方式:</label>
											<div class="col-sm-6"> 
											
											<ossp:value dictType="PAYMENT_METHOD" key="${associated.paymentMethod}"></ossp:value>
											</div>
									</div>
						</div>		
		
		
						<div class="f_2">	
									<div class="form-group col-sm-6">
										<label for="inputtext3" class="col-sm-4	 f_4">供应商经营方式:</label>
											<div class="col-sm-6"> 
												<ossp:value dictType="BUSINESS_TYPE_" key="${associated.suppierOperation}"></ossp:value>
												
											</div>
									</div>
							
						</div>
					</div>
				 
				 
				  <div class="tab-pane" id="contractBrand_tab">
			  		 <div> 
							<table class="table table-striped table-hover o-l-table" id="table1">
								<thead>
										<tr>
											<th>中文名称</th> 
											<th>英文文名称</th> 
										    <th>招商分类</th>
										    <th>品牌责任人</th>
										    <th>商铺</th>
										</tr>
								</thead>
								<tbody id="tableBrand">
									<c:forEach items="${assbrand}" var="assbrand" varStatus="i">
										<tr onclick="edit_brand(this,${i.index})" data-herf="" data-target="_self">
											<td  >
									<input style="display: none" name="assbrandBox" type="checkbox" value="${i.index }"/>
											<input type="hidden" id="assbrand_id${i.index }" name="assbrandsList[${i.index }].id" value="${assbrand.id}"/>
											<input type="hidden" id="brandNo${i.index }" name="assbrandsList[${i.index }].brandNo" value="${assbrand.brandNo}"/>
											<input type="hidden" id="brandId${i.index }" name="assbrandsList[${i.index }].brandId"  value="${assbrand.brandId}"/>
											<input type="hidden" id="brandCName${i.index }" name="assbrandsList[${i.index }].brandCName"  value="${assbrand.brandCName}" />
											<input type="hidden" id="brandEName${i.index }" name="assbrandsList[${i.index }].brandEName"  value="${assbrand.brandEName}" />
											<input type="hidden" id="brandLevel${i.index }" name="assbrandsList[${i.index }].brandLevel"  value="${assbrand.brandLevel}"  />
											<input type="hidden" id="brandAttribute${i.index }" name="assbrandsList[${i.index }].brandAttribute"  value="${assbrand.brandAttribute}"  />
											<input type="hidden" id="commodityCate${i.index }" name="assbrandsList[${i.index }].commodityCate"  value="${assbrand.commodityCate}" />
											<input type="hidden" id="inviteCate${i.index }" name="assbrandsList[${i.index }].inviteCate"  value="${assbrand.inviteCate}" />
											<input type="hidden" id="brandInviteHead${i.index }" name="assbrandsList[${i.index }].brandInviteHead"  value="${assbrand.brandInviteHead}" />
											<input type="hidden" id="memberRateType${i.index}" name="assbrandsList[${i.index }].memberRateType"  value="${assbrand.memberRateType}" />
											<input type="hidden" id="gcardDiscount${i.index}" name="assbrandsList[${i.index }].gcardDiscount"  value="${assbrand.gcardDiscount}" />
											<input type="hidden" id="gcardDiscount2${i.index}" name="assbrandsList[${i.index }].gcardDiscount2"  value="${assbrand.gcardDiscount2}" />
											<input type="hidden" id="ocardDiscount${i.index}" name="assbrandsList[${i.index }].ocardDiscount"  value="${assbrand.ocardDiscount}" />
											<input type="hidden" id="ocardDiscount2${i.index}" name="assbrandsList[${i.index }].ocardDiscount2"  value="${assbrand.ocardDiscount2}" /> 
											<input type="hidden" id="mainBarnd${i.index}" name="assbrandsList[${i.index }].mainBarnd"  value="${assbrand.mainBarnd}" /> 
											<input type="hidden" id="purchasingGroup${i.index}" name="assbrandsList[${i.index }].purchasingGroup"  value="${assbrand.purchasingGroup}" /> 
											<input type="hidden" id="assShopIds${i.index}" name="assbrandsList[${i.index}].assShopIds" value="<c:forEach items="${assbrand.assbsh}" var="assbsh" varStatus="j">${assbsh.shop.shopId},</c:forEach>" />
											<input type="hidden" id="shopNames${i.index}" name="assbrandsList[${i.index}].shopNames" value="<c:forEach items="${assbrand.assbsh}" var="assbsh" varStatus="j">${assbsh.shop.shop},</c:forEach>" />
											<input type="hidden" id="iszs${i.index}"name="assbrandsList[${i.index}].iszs"value="${assbrand.iszs}" />
												${assbrand.brandCName}
											</td>
											<td>${assbrand.brandEName}</td>
											<td>${assbrand.cmcate.cateName}</td>
											<td>${assbrand.brandInviteHead}</td>
											<td>
											<c:forEach items="${assbrand.assbsh}" var="assbsh" varStatus="j">
												${assbsh.shop.shop}
												<c:if test="${fn:length(assbrand.assbsh)}!=${j.index}">
												,
												</c:if>
														
												</c:forEach>
											</td>
										
										</tr>
						           </c:forEach>
								</tbody>
							</table>
					 </div>
				 </div>
		
				<div class="tab-pane" id="contractCommnWhere_tab">
			
			  		 <div> 
							<table class="table table-striped table-hover o-l-table" id="table1">
								<thead>
										<tr>
											<th>扣款项代码</th>
											<th>扣款项</th>
										    <th>金额/比例</th>
										    <th >开始日期</th>
										    <th >结束日期</th>
										    <th>扣款时效类型</th>
										    <th>计算基数</th>
										    <th>税率</th>
							
										</tr>
								</thead>
								<tbody id="contractCommnWhere">
								<c:forEach items="${assitems}" var="assitems" varStatus="i">
										<tr onclick="edit_assitems(this,${i.index })" data-herf="" data-target="_self">
											<td >
												<input type="checkbox" style="display: none"  name="assitemsBox" value="${i.index }" />
												<input type="hidden" id="assitems_id${i.index}"  value="${assitems.id}"/>
												<input type="hidden" id="deductItem_items${i.index}" name="assitemsList[${i.index}].deductItem" value="${assitems.deductItem}"/>
												<input type="hidden" id="deductCate_items${i.index}" name="assitemsList[${i.index}].deductCate" value="${assitems.deductCate}" />
												<input type="hidden" id="amount_items${i.index}" name="assitemsList[${i.index}].amount" value="${assitems.amount}" />
												<input type="hidden" id="startDate_items${i.index}"  name="assitemsList[${i.index}].startDate" value="<fmt:formatDate value="${assitems.startDate}" pattern="yyyy-MM-dd"/>"  />
												<input type="hidden" id="endDate_items${i.index}"  name="assitemsList[${i.index}].endDate" value="<fmt:formatDate value="${assitems.endDate}" pattern="yyyy-MM-dd"/>"  />
												<input type="hidden" id="validType_items${i.index }" name="assitemsList[${i.index}].validType" value="${assitems.validType}" class="form-control "/>
												<input type="hidden" id="countBase_items${i.index }" name="assitemsList[${i.index}].countBase" value="${assitems.countBase}" class="form-control "/>
												<input type="hidden" id="deductType_items${i.index }" name="assitemsList[${i.index}].deductType" value="${assitems.deductType}" class="form-control "/>
												<input type="hidden" id="deductCode_items${i.index }" name="assitemsList[${i.index}].deductCode" value="${assitems.deductCode}" class="form-control "/>
												<input type="hidden" id="taxRate_items${i.index }" name="assitemsList[${i.index}].taxRate" value="${assitems.taxRate}" class="form-control "/>
												<input type="hidden" id="taxRateCode_items${i.index }" name="assitemsList[${i.index}].taxRateCode" value="${assitems.taxRateCode}" class="form-control "/>
												<input type="hidden" id="remarks_items${i.index }" name="assitemsList[${i.index}].remarks" value="${assitems.remarks}" class="form-control "/>
											${assitems.deductCode}</td>
											<td>${assitems.deductItem}</td>
											<td ><fmt:formatNumber value="${assitems.amount}" pattern="#.00#"/>
											<c:if test="${fn:startsWith(assitems.deductCode, 'A')}">%</c:if></td>
											<td ><fmt:formatDate value="${assitems.startDate}" pattern="yyyy-MM-dd"/></td>
											<td ><fmt:formatDate value="${assitems.endDate}" pattern="yyyy-MM-dd"/></td>
											<td ><ossp:value dictType="DEFEND_SYTLE" key="${assitems.validType}"/></td> 
											<td ><ossp:value dictType="COMPUTE_BASE" key="${assitems.countBase}"/></td> 
											<td >${assitems.baseRate.taxRateRemark}</td> 
										</tr>
						           </c:forEach>
								</tbody>
							</table>
					 </div>
				 </div>
			 		<div class="tab-pane" id="workflow"> 
							<c:import url="/WEB-INF/views/bpm/workflow/workFlowInfo_view.jsp">
								<c:param name="formName" value="com.maoye.ossp.biz.contract.entity.SelfAssociated" />
								<c:param name="flowKey" value="SelfAssociated" />
								<c:param name="businessId" value="${associated.id}"/>
								<c:param name="method" value="${method}"/>
								<c:param name="isStart" value="${isStart}"/>
							</c:import> 			
					   </div>
						<div class="tab-pane" id="diagram" style="overflow-x:auto;">
							<iframe id="diagram_iframe" scrolling="no" frameborder=0 width="100%">
							</iframe>
					   </div>
			 <div class="tab-pane" id="contract_hist">
			 	<iframe id="versionFrame"   name="versionFrame"  
												scrolling="no" frameborder="no" width="100%"></iframe>
			 </div>
			 
			</div> 
			
		</div> 	
		
		    <div class="o-l-action">
			   <a class="btn btn-info btn_3 btn_right" role="button" href="${contextPath}/biz/contract/selfassociated/list?navId=${navId}&pageNo=${pageNo}">返回</a>
			   <c:if test="${associated.contractStatus !='00'&&associated.contractStatus !='10'}">
				   	   <shiro:hasPermission name=" com.maoye.ossp.biz.contract.manage.AssociatedContract:sendToSap">
							  <a class="btn btn-info btn_3 btn_right" type="button"  onclick="sendSap()">提交SAP</a>
			 		    </shiro:hasPermission>
				     <c:if test="${associated.contractStatus != '60'}">
				    	<c:if test="${associated.isNew == '0'}">
							
							<c:if test="${associated.isApprove != '1'}">
							 <shiro:hasPermission name="com.maoye.ossp.biz.contract.manage.AssociatedContract:edit">	
							    <a class="btn btn-info btn_3 btn_right" role="button" onclick="return Oosp_Confirm('确定要变更合同吗？？', this.href)" href="${contextPath}/biz/contract/assrecord/editAssociated?contractId=${id}&type=${associated.contractAttribute}&contractType=Z300&isModifyContract=1&navId=${navId}" data-target="#myModal">变&nbsp更</a>	<!-- btn_onClick() --> 
		    					<a class="btn btn-info btn_3 btn_right" role="button" onclick="return Oosp_Confirm('确定要续签合同吗？？', this.href)" href="${contextPath}/biz/contract/assrecord/editAssociated?contractId=${id}&type=30&contractType=Z300&navId=${navId}">续&nbsp签</a>
		    					<a  class="btn btn-info btn_3 btn_right" role="button" onclick="return Oosp_Confirm('确定要展期合同吗？？', this.href)" href="${contextPath}/biz/contract/assrecord/editAssociated?contractId=${id}&type=40&contractType=Z300&navId=${navId}"  data-target="#myModal">展&nbsp期</a>
		    				</shiro:hasPermission>
		    				 <shiro:hasPermission name="com.maoye.ossp.biz.contract.manage.SelfAssociated:addSelfterminate">	
				    			<a  class="btn btn-danger btn_3 btn_right" data-toggle="modal" onclick="return Oosp_Confirm('确定要终止合同吗？？', this.href)" href="${contextPath}/biz/intent/intSelfterminate/${id}/add?navId=${navId}">撤&nbsp;柜</a>
				    		</shiro:hasPermission>
				    		 <shiro:hasPermission name="com.maoye.ossp.biz.contract.manage.SelfAssociated:addSelfdiscard">	 
								<a  class="btn btn-danger btn_3 btn_right" data-toggle="modal" onclick="return Oosp_Confirm('确定要作废合同吗？？', this.href)" href="${contextPath}/biz/intent/intSelfdiscard/${id}/add?navId=${navId}">作&nbsp;废</a>
							</shiro:hasPermission>
							</c:if> 
							 <shiro:hasPermission name="com.maoye.ossp.biz.contract.manage.SelfAssociated:receiveContract">	 
			    				<c:if test="${associated.recieveStatus == '0'}">
			    					<a class="btn btn-info btn_3 btn_right" role="button" onclick="return Oosp_Confirm('确认要领取合同文本？', this.href)" href="${contextPath}/biz/contract/selfassociated/${id}/receiveContract?navId=${navId}">文本领取</a>
			    				</c:if>
		    				</shiro:hasPermission>
		    				
		    				<shiro:hasPermission name="com.maoye.ossp.biz.contract.manage.SelfAssociated:formalContract">
			   					 <c:if test="${associated.contractAttribute == '10'}">
			   					 <a class="btn btn-danger btn_3 btn_right" role="button" onclick="return Oosp_Confirm('确定转正式合同吗？？', this.href)" href="${contextPath}/biz/contract/selfassociated/formalContract?navId=${navId}&id=${id}" data-target="#myModal">>转&nbsp正式&nbsp;合同</a>	<!-- btn_onClick() -->
			   					 </c:if>
  					 	    </shiro:hasPermission>
				    	</c:if>
	    			</c:if>
    			</c:if>
    		 <%-- <c:if test="${associated.contractStatus =='00'||associated.contractStatus =='10'}">
	    			<a class="btn btn-success btn_5 btn_right" role="button" onclick="return Oosp_Confirm('确定要修改合同吗？？', this.href)" href="${contextPath}/biz/contract/selfassociated/${id}/edit?navId=${navId}">修&nbsp改</a>
	    		</c:if> --%>
	    		<shiro:hasPermission name="com.maoye.ossp.biz.contract.manage.SelfAssociated:update">
	    		
	    		<c:if test="${associated.isNew == '0' && associated.contractStatus == '00'}">  
	    		<a class="btn btn-success btn_5 btn_right" role="button" onclick="return Oosp_Confirm('确定要修改合同吗？？', this.href)" href="${contextPath}/biz/contract/selfassociated/${id}/edit?navId=${navId}">修&nbsp改</a>
	    		</c:if>	
	    		</shiro:hasPermission>
		   </div>
	</div>
	<div class="modal fade" id="terminateDateModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"></div> 
	<!-- Modal -->
	<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"></div> 
<!-- Modal -->
	<div class="modal fade" id="supplierModal" style="width:800" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"></div> 
	<div class="modal fade" id="barndModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"></div> 		
	<div class="modal fade" id="assitems"  tabindex="-1"  style="display: none;"></div> 
	<div class="modal fade" id="assbasemodal"  tabindex="-1"  style="display: none;"></div> 	
	</div>	
	<script type="text/javascript">
	$('.form_date').datetimepicker({
        language:  'zh-CN',
        weekStart: 1,
        todayBtn:  1,
		autoclose: 0,
		todayHighlight: 1,
		startView: 2,
		minView: 2,
		forceParse: 0,
		format: 'yyyy-mm-dd'
		
    });


</script>
</body>

</html>